<template>
    <el-container>
        <el-header>
            <el-col class="headname">商品管理</el-col>
            <el-col class="lianjie">

                <template>
                    <el-tabs v-model="activeName" @tab-click="handleClick" class="tabbottom">
                        <el-tab-pane label="商品管理" name="first">

                            <goods @child="foo"></goods>

                        </el-tab-pane>
                        <el-tab-pane label="添加商品" name="second"><add></add></el-tab-pane>
                        <el-tab-pane label="商品回收站" name="fourth"><delAll></delAll></el-tab-pane>
                        <el-tab-pane label="修改商品" name="third" v-if="activeName=='third'"><mix></mix></el-tab-pane>
                    </el-tabs>
                </template>

            </el-col>
        </el-header>

    </el-container>
</template>

<script>
    import goods from "./goods";
    import add from "./add";
    import mix from "./mix";
    import delAll from "./delAll";
    export default {
        name: "shopindex",
        components:{
            goods,
            add,
            mix,
            delAll,
        },


        data() {
            return {
                activeName: 'first'
            };
        },
        methods: {
            handleClick(tab, event) {
                console.log(tab, event);
            },
            foo(a){
                this.activeName=a
            }
        }

    }
</script>

<style scoped>
    .headname{
        text-align: left;
        font-size:18px;
        margin: 5px 5px 5px 0;
    }
    .lianjie{
        margin: 8px 8px 10px 0;
    }
    .tabbottom{
        margin-bottom: 10px;
    }
</style>